<script src="<?php echo get_url('js/jquery.ajaxfileupload.js');?>" type="text/javascript"></script>
<script src="<?php echo get_url('js/checkpreviewimg.js');?>" type="text/javascript"></script>
<div class="index-container w1024 bc">
    <div class="doctor-form">
        <h1 class="f24 mt30 mb20 tc">医师申请表</h1>
        <div class="prev-title f14 pl20 pr10 clearfix"><span class="fl">请填写你的认证资料(医生资格证书)</span><span class="fr mr30">为何申请服务类型？</span></div>
        <p class="form-msg pl20 pr20 clearfix"><span class="fl">您的个人隐私信息均不会被公开，只用于认证医师资格及核实医生本人信息。</span><span class="fr">所填信息都会有51天使平台认证</span></p>
        <p class="form-msg pl20 pr20">请尽量填写完所有内容，加快申请审核进度。</p>
        <div class="status-box p20">
            <div class="clearfix">
                <div class="fl">
                    <p class="mt10">医师执业证书<input type="file" id="profession_img" name="profession_img" class="input-01 ml10 mr10" />
                        <input type="button" value="上传医师执业证书" onclick="return upload_image('profession_img',1);" >
                        <input type="hidden" id="user_profession_img"
                               value="<?php echo isset($response['doctors']) && isset($response['doctors']['ProfessionImage']) ? $response['doctors']['ProfessionImage'] : '';?>" name="user_profession_img"/>
                        <img id="src_profession_img"
                             src="<?php echo isset($response['doctors']) && isset($response['doctors']['ProfessionImage']) ? '/center/doctors/show_img?id='.$response['doctors']['ProfessionImage'].'&t='.rand(10,50) : '';?>"
                             alt="医师执业证书" class="fl" width="100" height="100" style="display:<?php if(isset($response['doctors']) && isset($response['doctors']['ProfessionImage'])): ?>block;<?php else:?>none<?php endif?>"/>
                        <span id="checkprofession_img"></span>
                    </p>
                    <p class="mt10">医师资格证书<input type="file" id="qualifications_img" name="qualifications_img"  class="input-01 ml10 mr10" />
                        <input type="button" value="上传医师资格证书" onclick="return upload_image('qualifications_img',1);" >
                        <input type="hidden" id="user_qualifications_img" value="<?php echo isset($response['doctors']) && isset($response['doctors']['QualificationImage'])? $response['doctors']['QualificationImage'] : '';?>" name="user_qualifications_img"/>
                        <img id="src_qualifications_img" src="<?php echo isset($response['doctors']) && isset($response['doctors']['QualificationImage']) ? '/center/doctors/show_img?id='.$response['doctors']['QualificationImage'].'&t='.rand(10,50) : '';?>"
                             alt="医师资格证书" class="fl" width="100" height="100" style="display:<?php if(isset($response['doctors']) && isset($response['doctors']['QualificationImage'])): ?>block;<?php else:?>none<?php endif?>;"/>
                        <span id="checkqualifications_img"></span>
                    </p>
<!--                    <p class="mt10">其他相关证明<input type="file" id="proof_img" name="proof_img"  class="input-01 ml10 mr10" />-->
<!--                        <input type="button" value="上传其他相关证明" onclick="return upload_image('proof_img',1);" >-->
<!--                        <input type="hidden" id="user_proof_img" value="--><?php //echo isset($response['doctors']) && isset($response['doctors']['proof_img']) ? $response['doctors']['proof_img'] : '';?><!--" name="user_proof_img"/>-->
<!--                        <img id="src_proof_img" src="--><?php //echo isset($response['doctors']) && $response['doctors']['proof_img'] ? '/center/doctors/show_img?name=proof_img&t='.rand(10,50) : '';?><!--"-->
<!--                             alt="其他相关证明" class="fl" width="100" height="100" style="display:--><?php //if(isset($response['doctors']) && $response['doctors']['proof_img']): ?><!--block;--><?php //else:?><!--none--><?php //endif?><!--;"/>-->
<!--                        <span id="checkproof_img"></span>-->
<!--                    </p>-->
                </div>
                <p class="fr"><span class="fl">注：</span><span class="block ml25">证件用来核实您的医生信息，保障您和患者的合法需求。人个擅长详细叙述您擅长治疗的疾病，我们会为您挑选所擅长问题供您解答。你的个人信息和擅长将展示给患者，这些事患者了解您的有效途径之一。</span></p>
            </div>
            <div class="msg">
                <p>所填信息都会有51天使平台认证</p>
                <p>其他个人资料如教育信息，个人介绍等可在认证完成后在个人中心的个人资料中完善。</p>
            </div>
        </div>
        <div class="mt20 tc">
            <a href="/center/doctors/app_first" class="button-01 mr20">上一步</a>
            <input value="下一步" type="button" class="button-01 mr20" onclick=" return md_submit()" >
        </div>
    </div>
</div>
<script>
    function md_submit() {
        var user_proof_img = $("#user_proof_img").val();
        var user_profession_img = $("#user_profession_img").val();
        var user_qualifications_img = $("#user_qualifications_img").val();
        if(user_profession_img == '') {
            $("#checkprofession_img").html('请上传医师执业证书');
            return false;
        }
        if(user_qualifications_img == '') {
            $("#checkqualifications_img").html('请上传医师资格证书');
            return false;
        }
        if(user_proof_img == '') {
            $("#checkproof_img").html('请上传其他相关证明');
            return false;
        }
        //走到下一步
        var params = 'app_fmt=json&app_page=null&profession_img='+user_profession_img+'&qualifications_img='+user_qualifications_img+'&proof_img='+user_proof_img;
        Ajax.call('/center/doctors/do_app_md', params, function (data) {
            data = eval('('+data+')');
            if(data.code ==0) {
                location.href='/center/doctors/app_last';
            }else {
                alert(data.msg);
            }
        });
    }
</script>